package org.logic.linguisticSummaries.type1summaries;

import org.logic.fuzzysets.AFuzzySet;
import org.logic.linguisticSummaries.ASummary;

public class SummaryTypeOne extends ASummary{

	protected String subject;
	protected AFuzzySet quantifier;
	protected AFuzzySet summarizer;
	
	public SummaryTypeOne(String subject, AFuzzySet quantifier, AFuzzySet summarizer) {
		this.subject = subject;
		this.quantifier = quantifier;
		this.summarizer = summarizer;
	}
	
	@Override
	public String generateSummary() {

		double normalizedCardinalValue = summarizer.getCardinalValue()/summarizer.getUniverse().size();
		
		setDegreeOfTruth(quantifier.getMembershipFunction().getMembershipDegree(normalizedCardinalValue));
		
		return quantifier.getLabel()+" "+subject+" "+summarizer.getLabel()+". [T:"+getDegreeOfTruth()+"]";
	}
}
